//
//  MentorToEditViewController.m
//  Edumap
//
//  Created by 辰领科技 on 16/7/22.
//  Copyright © 2016年 yuf. All rights reserved.
//

#import "MentorToEditViewController.h"

@interface MentorToEditViewController ()
@property (strong, nonatomic) IBOutlet UILabel *titleLabel;
@property (strong, nonatomic) IBOutlet UIView *navView;
@property (strong, nonatomic) IBOutlet UIScrollView *scroview;
@property (strong, nonatomic) IBOutlet UITextField *nameTextField;//联系人
@property (strong, nonatomic) IBOutlet UITextField *phoneNumberTextField;//手机号
@property (strong, nonatomic) IBOutlet UIButton *deleteButton;



@end

@implementation MentorToEditViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    [self initViewLayout];
}

- (void)initViewLayout{
    [self adaptiveViewLayout:self.view];
    [self adaptiveViewLayout:self.navView];
    [self adaptiveViewLayout:self.scroview];
    _scroview.contentSize = flexibleSize(CGSizeMake(0, 505), NO);
    
    self.deleteButton.layer.cornerRadius = 5*VerticalRatio();
    [_nameTextField setValue:[UIColor colorWithWhite:0.396 alpha:1.000]
                  forKeyPath:@"_placeholderLabel.textColor"];
    [_phoneNumberTextField setValue:[UIColor colorWithWhite:0.396 alpha:1.000]
                         forKeyPath:@"_placeholderLabel.textColor"];
    
    if (_isEditContact) {
        _deleteButton.hidden = NO;
        _titleLabel.text = @"编辑联系人";
    } else if (!_isEditContact) {
        _deleteButton.hidden = YES;
        _titleLabel.text = @"新建联系人";
    }
    
}



- (IBAction)back:(id)sender {
    [self backBtn];
}

#pragma mark - 保存
- (IBAction)save:(id)sender {
    
}

#pragma mark - 删除
- (IBAction)delete:(UIButton *)sender {
    _isEditContact = sender.selected;
    sender.selected = !sender.selected;
    [self initViewLayout];
}



@end
